#ifndef __INETADDRESS_H__
#define __INETADDRESS_H__

#include <sys/socket.h>
#include <arpa/inet.h>

#include <string>

using std::string;

namespace cdm{

class InetAddress{
public:

    InetAddress(uint16_t port,const string &ip);
    InetAddress(const struct sockaddr_in &addr);

    string ip()const;    

    uint16_t port()const;

    const struct sockaddr_in* getAddressPtr()const;
    
private:
    struct sockaddr_in _addr;
};

}//end of namespace

#endif

